Optimal. Leaf size=239 \[ -\frac {\left (a^2-b^2\right ) x}{\left (a^2+b^2\right )^2}-\frac {2 a b \log (\cos (c+d x))}{\left (a^2+b^2\right )^2 d}-\frac {2 a^5 \left (2 a^2+3 b^2\right ) \log (a+b \tan (c+d x))}{b^5 \left (a^2+b^2\right )^2 d}+\frac {\left (4 a^4+2 a^2 b^2-b^4\right ) \tan (c+d x)}{b^4 \left (a^2+b^2\right ) d}-\frac {a \left (2 a^2+b^2\right ) \tan ^2(c+d x)}{b^3 \left (a^2+b^2\right ) d}+\frac {\left (4 a^2+b^2\right ) \tan ^3(c+d x)}{3 b^2 \left (a^2+b^2\right ) d}-\frac {a^2 \tan ^4(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.51, antiderivative size = 239, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3646, 3728,
3707, 3698, 31, 3556} \begin {gather*} -\frac {a^2 \tan ^4(c+d x)}{b d \left (a^2+b^2\right ) (a+b \tan (c+d x))}+\frac {\left (4 a^2+b^2\right ) \tan ^3(c+d x)}{3 b^2 d \left (a^2+b^2\right )}-\frac {2 a b \log (\cos (c+d x))}{d \left (a^2+b^2\right )^2}-\frac {x \left (a^2-b^2\right )}{\left (a^2+b^2\right )^2}-\frac {a \left (2 a^2+b^2\right ) \tan ^2(c+d x)}{b^3 d \left (a^2+b^2\right )}-\frac {2 a^5 \left (2 a^2+3 b^2\right ) \log (a+b \tan (c+d x))}{b^5 d \left (a^2+b^2\right )^2}+\frac {\left (4 a^4+2 a^2 b^2-b^4\right ) \tan (c+d x)}{b^4 d \left (a^2+b^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 3556
Rule 3646
Rule 3698
Rule 3707
Rule 3728
Rubi steps
\begin {align*} \int \frac {\tan ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx &=-\frac {a^2 \tan ^4(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}+\frac {\int \frac {\tan ^3(c+d x) \left (4 a^2-a b \tan (c+d x)+\left (4 a^2+b^2\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{b \left (a^2+b^2\right )}\\ &=\frac {\left (4 a^2+b^2\right ) \tan ^3(c+d x)}{3 b^2 \left (a^2+b^2\right ) d}-\frac {a^2 \tan ^4(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}+\frac {\int \frac {\tan ^2(c+d x) \left (-3 a \left (4 a^2+b^2\right )-3 b^3 \tan (c+d x)-6 a \left (2 a^2+b^2\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{3 b^2 \left (a^2+b^2\right )}\\ &=-\frac {a \left (2 a^2+b^2\right ) \tan ^2(c+d x)}{b^3 \left (a^2+b^2\right ) d}+\frac {\left (4 a^2+b^2\right ) \tan ^3(c+d x)}{3 b^2 \left (a^2+b^2\right ) d}-\frac {a^2 \tan ^4(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}+\frac {\int \frac {\tan (c+d x) \left (12 a^2 \left (2 a^2+b^2\right )+6 a b^3 \tan (c+d x)+6 \left (4 a^4+2 a^2 b^2-b^4\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{6 b^3 \left (a^2+b^2\right )}\\ &=\frac {\left (4 a^4+2 a^2 b^2-b^4\right ) \tan (c+d x)}{b^4 \left (a^2+b^2\right ) d}-\frac {a \left (2 a^2+b^2\right ) \tan ^2(c+d x)}{b^3 \left (a^2+b^2\right ) d}+\frac {\left (4 a^2+b^2\right ) \tan ^3(c+d x)}{3 b^2 \left (a^2+b^2\right ) d}-\frac {a^2 \tan ^4(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}+\frac {\int \frac {-6 a \left (4 a^4+2 a^2 b^2-b^4\right )+6 b^5 \tan (c+d x)-12 a \left (2 a^4+a^2 b^2-b^4\right ) \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{6 b^4 \left (a^2+b^2\right )}\\ &=-\frac {\left (a^2-b^2\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (4 a^4+2 a^2 b^2-b^4\right ) \tan (c+d x)}{b^4 \left (a^2+b^2\right ) d}-\frac {a \left (2 a^2+b^2\right ) \tan ^2(c+d x)}{b^3 \left (a^2+b^2\right ) d}+\frac {\left (4 a^2+b^2\right ) \tan ^3(c+d x)}{3 b^2 \left (a^2+b^2\right ) d}-\frac {a^2 \tan ^4(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}+\frac {(2 a b) \int \tan (c+d x) \, dx}{\left (a^2+b^2\right )^2}-\frac {\left (2 a^5 \left (2 a^2+3 b^2\right )\right ) \int \frac {1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b^4 \left (a^2+b^2\right )^2}\\ &=-\frac {\left (a^2-b^2\right ) x}{\left (a^2+b^2\right )^2}-\frac {2 a b \log (\cos (c+d x))}{\left (a^2+b^2\right )^2 d}+\frac {\left (4 a^4+2 a^2 b^2-b^4\right ) \tan (c+d x)}{b^4 \left (a^2+b^2\right ) d}-\frac {a \left (2 a^2+b^2\right ) \tan ^2(c+d x)}{b^3 \left (a^2+b^2\right ) d}+\frac {\left (4 a^2+b^2\right ) \tan ^3(c+d x)}{3 b^2 \left (a^2+b^2\right ) d}-\frac {a^2 \tan ^4(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}-\frac {\left (2 a^5 \left (2 a^2+3 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^5 \left (a^2+b^2\right )^2 d}\\ &=-\frac {\left (a^2-b^2\right ) x}{\left (a^2+b^2\right )^2}-\frac {2 a b \log (\cos (c+d x))}{\left (a^2+b^2\right )^2 d}-\frac {2 a^5 \left (2 a^2+3 b^2\right ) \log (a+b \tan (c+d x))}{b^5 \left (a^2+b^2\right )^2 d}+\frac {\left (4 a^4+2 a^2 b^2-b^4\right ) \tan (c+d x)}{b^4 \left (a^2+b^2\right ) d}-\frac {a \left (2 a^2+b^2\right ) \tan ^2(c+d x)}{b^3 \left (a^2+b^2\right ) d}+\frac {\left (4 a^2+b^2\right ) \tan ^3(c+d x)}{3 b^2 \left (a^2+b^2\right ) d}-\frac {a^2 \tan ^4(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 6.24, size = 242, normalized size = 1.01 \begin {gather*} \frac {\tan ^4(c+d x)}{3 b d (a+b \tan (c+d x))}+\frac {-\frac {2 a \tan ^3(c+d x)}{b d (a+b \tan (c+d x))}+\frac {\frac {3 i b^2 \log (i-\tan (c+d x))}{(a+i b)^2 d}-\frac {3 i b^2 \log (i+\tan (c+d x))}{(a-i b)^2 d}-\frac {12 a^5 \left (2 a^2+3 b^2\right ) \log (a+b \tan (c+d x))}{b^3 \left (a^2+b^2\right )^2 d}-\frac {6 \left (1-\frac {2 a^2}{b^2}\right ) \tan (c+d x)}{d}-\frac {6 a^4 \left (2 a^2+b^2\right )}{b^3 \left (a^2+b^2\right ) d (a+b \tan (c+d x))}}{2 b}}{3 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 168, normalized size = 0.70
method | result | size |
derivativedivides | \(\frac {\frac {\frac {b^{2} \left (\tan ^{3}\left (d x +c \right )\right )}{3}-a b \left (\tan ^{2}\left (d x +c \right )\right )+3 a^{2} \tan \left (d x +c \right )-b^{2} \tan \left (d x +c \right )}{b^{4}}+\frac {a b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )+\left (-a^{2}+b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}-\frac {a^{6}}{b^{5} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (d x +c \right )\right )}-\frac {2 a^{5} \left (2 a^{2}+3 b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{5} \left (a^{2}+b^{2}\right )^{2}}}{d}\) | \(168\) |
default | \(\frac {\frac {\frac {b^{2} \left (\tan ^{3}\left (d x +c \right )\right )}{3}-a b \left (\tan ^{2}\left (d x +c \right )\right )+3 a^{2} \tan \left (d x +c \right )-b^{2} \tan \left (d x +c \right )}{b^{4}}+\frac {a b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )+\left (-a^{2}+b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}-\frac {a^{6}}{b^{5} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (d x +c \right )\right )}-\frac {2 a^{5} \left (2 a^{2}+3 b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{5} \left (a^{2}+b^{2}\right )^{2}}}{d}\) | \(168\) |
norman | \(\frac {\frac {\left (2 a^{2}-b^{2}\right ) \left (\tan ^{2}\left (d x +c \right )\right )}{b^{3} d}+\frac {\tan ^{4}\left (d x +c \right )}{3 b d}-\frac {2 a \left (\tan ^{3}\left (d x +c \right )\right )}{3 b^{2} d}-\frac {\left (a^{2}-b^{2}\right ) a x}{a^{4}+2 a^{2} b^{2}+b^{4}}-\frac {b \left (a^{2}-b^{2}\right ) x \tan \left (d x +c \right )}{a^{4}+2 a^{2} b^{2}+b^{4}}-\frac {\left (4 a^{5}+2 a^{3} b^{2}-a \,b^{4}\right ) a}{d \,b^{5} \left (a^{2}+b^{2}\right )}}{a +b \tan \left (d x +c \right )}+\frac {a b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {2 a^{5} \left (2 a^{2}+3 b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) b^{5} d}\) | \(263\) |
risch | \(\frac {x}{2 i a b -a^{2}+b^{2}}+\frac {8 i a^{7} x}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) b^{5}}+\frac {8 i a^{7} c}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) b^{5} d}+\frac {12 i a^{5} x}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) b^{3}}+\frac {12 i a^{5} c}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) b^{3} d}-\frac {8 i a^{3} x}{b^{5}}-\frac {8 i a^{3} c}{b^{5} d}+\frac {4 i a x}{b^{3}}+\frac {4 i a c}{b^{3} d}-\frac {2 i \left (-12 i a^{3} b^{3} {\mathrm e}^{4 i \left (d x +c \right )}+6 i a \,b^{5} {\mathrm e}^{6 i \left (d x +c \right )}-24 i a^{5} b \,{\mathrm e}^{4 i \left (d x +c \right )}+12 a^{6} {\mathrm e}^{6 i \left (d x +c \right )}+6 a^{4} b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+3 a^{2} b^{4} {\mathrm e}^{6 i \left (d x +c \right )}+6 b^{6} {\mathrm e}^{6 i \left (d x +c \right )}+14 i a \,b^{5} {\mathrm e}^{2 i \left (d x +c \right )}-6 i a^{3} b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-12 i a^{5} b \,{\mathrm e}^{6 i \left (d x +c \right )}+36 a^{6} {\mathrm e}^{4 i \left (d x +c \right )}+18 a^{4} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-9 a^{2} b^{4} {\mathrm e}^{4 i \left (d x +c \right )}+12 i a \,b^{5} {\mathrm e}^{4 i \left (d x +c \right )}+2 i a^{3} b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-12 i a^{5} b \,{\mathrm e}^{2 i \left (d x +c \right )}+36 a^{6} {\mathrm e}^{2 i \left (d x +c \right )}+26 a^{4} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 a^{2} b^{4} {\mathrm e}^{2 i \left (d x +c \right )}-2 b^{6} {\mathrm e}^{2 i \left (d x +c \right )}+12 a^{6}+14 a^{4} b^{2}+a^{2} b^{4}-4 b^{6}\right )}{3 \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3} \left (-i a +b \right ) \left (i a +b \right )^{2} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right ) b^{4} d}-\frac {4 a^{7} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) b^{5} d}-\frac {6 a^{5} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) b^{3} d}+\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{5} d}-\frac {2 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{3} d}\) | \(754\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.66, size = 206, normalized size = 0.86 \begin {gather*} -\frac {\frac {3 \, a^{6}}{a^{3} b^{5} + a b^{7} + {\left (a^{2} b^{6} + b^{8}\right )} \tan \left (d x + c\right )} - \frac {3 \, a b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {3 \, {\left (a^{2} - b^{2}\right )} {\left (d x + c\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {6 \, {\left (2 \, a^{7} + 3 \, a^{5} b^{2}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{4} b^{5} + 2 \, a^{2} b^{7} + b^{9}} - \frac {b^{2} \tan \left (d x + c\right )^{3} - 3 \, a b \tan \left (d x + c\right )^{2} + 3 \, {\left (3 \, a^{2} - b^{2}\right )} \tan \left (d x + c\right )}{b^{4}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.37, size = 387, normalized size = 1.62 \begin {gather*} -\frac {6 \, a^{6} b^{2} + 6 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - {\left (a^{4} b^{4} + 2 \, a^{2} b^{6} + b^{8}\right )} \tan \left (d x + c\right )^{4} + 2 \, {\left (a^{5} b^{3} + 2 \, a^{3} b^{5} + a b^{7}\right )} \tan \left (d x + c\right )^{3} + 3 \, {\left (a^{3} b^{5} - a b^{7}\right )} d x - 3 \, {\left (2 \, a^{6} b^{2} + 3 \, a^{4} b^{4} - b^{8}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (2 \, a^{8} + 3 \, a^{6} b^{2} + {\left (2 \, a^{7} b + 3 \, a^{5} b^{3}\right )} \tan \left (d x + c\right )\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - 3 \, {\left (2 \, a^{8} + 3 \, a^{6} b^{2} - a^{2} b^{6} + {\left (2 \, a^{7} b + 3 \, a^{5} b^{3} - a b^{7}\right )} \tan \left (d x + c\right )\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) - 3 \, {\left (4 \, a^{7} b + 4 \, a^{5} b^{3} - a^{3} b^{5} - 2 \, a b^{7} - {\left (a^{2} b^{6} - b^{8}\right )} d x\right )} \tan \left (d x + c\right )}{3 \, {\left ({\left (a^{4} b^{6} + 2 \, a^{2} b^{8} + b^{10}\right )} d \tan \left (d x + c\right ) + {\left (a^{5} b^{5} + 2 \, a^{3} b^{7} + a b^{9}\right )} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 1.51, size = 3279, normalized size = 13.72 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.44, size = 251, normalized size = 1.05 \begin {gather*} \frac {\frac {3 \, a b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {3 \, {\left (a^{2} - b^{2}\right )} {\left (d x + c\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {6 \, {\left (2 \, a^{7} + 3 \, a^{5} b^{2}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{4} b^{5} + 2 \, a^{2} b^{7} + b^{9}} + \frac {3 \, {\left (4 \, a^{7} b \tan \left (d x + c\right ) + 6 \, a^{5} b^{3} \tan \left (d x + c\right ) + 3 \, a^{8} + 5 \, a^{6} b^{2}\right )}}{{\left (a^{4} b^{5} + 2 \, a^{2} b^{7} + b^{9}\right )} {\left (b \tan \left (d x + c\right ) + a\right )}} + \frac {b^{4} \tan \left (d x + c\right )^{3} - 3 \, a b^{3} \tan \left (d x + c\right )^{2} + 9 \, a^{2} b^{2} \tan \left (d x + c\right ) - 3 \, b^{4} \tan \left (d x + c\right )}{b^{6}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.38, size = 213, normalized size = 0.89 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}{2\,d\,\left (-a^2\,1{}\mathrm {i}+2\,a\,b+b^2\,1{}\mathrm {i}\right )}-\frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (\frac {4\,a^3}{b^5}-\frac {2\,a}{b^3}+\frac {2\,a\,b}{{\left (a^2+b^2\right )}^2}\right )}{d}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,b^2\,d}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {a^2+b^2}{b^4}-\frac {4\,a^2}{b^4}\right )}{d}-\frac {a\,{\mathrm {tan}\left (c+d\,x\right )}^2}{b^3\,d}-\frac {a^6}{b\,d\,\left (\mathrm {tan}\left (c+d\,x\right )\,b^5+a\,b^4\right )\,\left (a^2+b^2\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d\,\left (-a^2+a\,b\,2{}\mathrm {i}+b^2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________